<?php
require_once 'Extension/Controller/Action.php';

class LanguageController extends Extension_Controller_Action 
{
	public function indexAction() 
    {
        $request = $this->getRequest();
        $language = $request->getParam('lang');

        if (!is_null($language)) {
            $namespace = Kbs::initConfig('Session')->namespace->locale;
            $locale = Kbs::initConfig('Locale')->$language;
            Kbs::initSession($namespace)->locale = $locale;
        }

        $this->_redirect('/');
    }

}